Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Namespaced controllers and Object is not missing constants XXX exception #530

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fuelxc
Copy link

@fuelxc fuelxc commented Dec 12, 2011

This change seems more like a workaround than a fix but I am unable to correct any other way and my previous change for including :class => lambda{} doesn't seem to be working in all cases

@smashtank
Copy link

added the passing of the controller to the lambda

@jeremyf
Copy link
Contributor

jeremyf commented May 11, 2012

@fuelxc Unfortunately the pull requests don't cleanly merge against master. Would you be able to rebase this and ping me to verify once you have a clean merge?

* 'master' of https://github.com/ryanb/cancan:
  Clarify readme for rails 2.3 users
  adding a .rbenv-version file
  Add check for Enumerable as condition value
  adding project status message to readme
  Just add singleton to description of authorize_resource
  Don't remove key-value from the subject hash we might want to use it again.
  adding travis-ci badge
  Pass forward :if and :unless options to the before filter. i.e:
  Fixed bug with params for actions that build new instances with namespaced models
  Use latest with_model gem

Conflicts:
	spec/cancan/controller_resource_spec.rb
@fuelxc
Copy link
Author

fuelxc commented May 11, 2012

I merged and pushed now.

Cheers

@jeremyf
Copy link
Contributor

jeremyf commented May 21, 2012

@ryanb The tests all pass. There are quite a few concepts going on, but they look good.

@andhapp
Copy link
Collaborator

andhapp commented Jun 23, 2012

@fuelxc: Thanks for the pull request and sorry for such a long delay in merging this request. Can you please give us a real-world use case where you encountered this issue originally. Quite a few namespace related pull requests have been merged recently and I just wanted to find out the actual issue this one is solving.

Thanks.

@fuelxc
Copy link
Author

fuelxc commented Jun 25, 2012

It was a fair bit ago, so I apologize that i can't remember exact details, but basically it was an STI and I was getting an exception "Object is not missing constants" on a namespaced controller. The only way I found to correct it was to use a lambda to determine what was needed on request.

@fuelxc
Copy link
Author

fuelxc commented Jan 16, 2013

Out of curiosity has this been solved a separate way?

@xhoy
Copy link

xhoy commented Jul 1, 2014

Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013.
Since only Ryan himself has commit permissions, the CanCan project is on a standstill.

CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994.

If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan.

We hope to see you on the other side!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants